<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>资讯信息管理</title>
    <link href="../../static/css/index.css" type="text/css" rel="stylesheet"/>
    <link rel="stylesheet" href="../../static/layui/css/layui.css"/>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!--头部导航栏-->
    <div id="head" th:include="common/header :: common_head(user=${session.user})"></div>
    <!--左边菜单栏-->
    <div id="left_column" th:include="common/left_column :: left_column(menuList=${session.menuList})"></div>
    <!-- 内容主体区域 -->
    <div class="layui-body">
        <div style="padding: 15px;">
            <div class="college_cloum">
                <div class="college_title">首页资讯信息管理</div>
                <div class="college_add"><button type="button" class="layui-btn" onclick="addInformation()">添加首页资讯信息</button></div>
                <hr>
                <div>
                    <blockquote class="layui-elem-quote">
                        <table class="layui-hide" id="information" lay-filter="information"></table>
                    </blockquote>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../../static/layui/layui.all.js"/>
<script></script>
<script>
    layui.use(['table', 'layer'], function(){
        var layer = layui.layer,
            table = layui.table,
            $ = layui.jquery;

        var tableIns = table.render({
            elem: '#information'
            ,url:'/manage/informationList'
            ,cols: [
                [
                    {field:'roleName', title:'资讯显示端'},
                    {field:'title', title:'资讯标题'},
                    {field:'content', title: '资讯内容'},
                    {field:'publishDate', title: '创建时间'},
                    {templet: complain, title: '操作', align:'center'}
                ]
            ]
        });

        //是否禁用按钮
        function complain(d){
            return [
                '<button type="button" style="text-align: center" class="layui-btn layui-btn-sm" onclick="updateInformation(\''+ d.id + '\')">查询/修改</button>',
            ]
                .join('');
        };

        //查询修改跳转页面
        window.updateInformation = function(id){
            window.location.href="/manage/informationDetail?id="+id;
        };

        //新增跳转页面
        window.addInformation = function () {
            // window.location.href="/manage/informationDetail";
            layer.msg("此功能暂时不提供")
        };
    });
</script>
</body>
</html>